unit LookupProductF;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, LookupF, FMTBcd, SqlExpr, Provider, DB, DBClient, Grids, DBGrids,
  DBGridA, SQLDataSetA, StrUtils;

type
  TLookupProductFrame = class(TLookupFrame)
    procedure DsFilterRecord(DataSet: TDataSet; var Accept: Boolean);
  private
  protected 
  public
    constructor Create(AOwner: TComponent; NotifySelection: TNotifyEvent); override;
  end;


implementation
uses
  ProgramM, StoreF, BaseF;


{$R *.dfm}

constructor TLookupProductFrame.Create(AOwner: TComponent;
  NotifySelection: TNotifyEvent);
begin
  inherited;
  Ds.CloneCursor(StoreFrame.Ds, True);
  Ds.OnFilterRecord := DsFilterRecord; // peab uuesti omistama
end;

procedure TLookupProductFrame.DsFilterRecord(DataSet: TDataSet;
  var Accept: Boolean);
begin
  Accept := ContainsText(' ' + DataSet.FieldByName('NIMETUS').AsString,
    ' ' + SearchString)
    or StartsText(SearchString, DataSet.FieldByName('KIIRKOOD').AsString);
end;

end.
